package edu.stanford.cs.cs294s;

import java.io.File;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;

import android.os.Environment;
import android.util.Log;


public class UploadImage{
	public UploadImage(){
		
	}
	
	public boolean uploadFile(){
		/*
		boolean success;
		try {
			DefaultHttpClient httpclient = new DefaultHttpClient();
			String fileName = Environment.getExternalStorageDirectory() + "/images/new-photo-name.jpg";
			File file = new File(fileName);

			HttpPost httpost = new HttpPost("http://myremotehost:8080/upload/upload");
			MultipartEntity entity = new MultipartEntity();
			entity.addPart("myIdentifier", new StringBody("somevalue"));
			entity.addPart("myFile", new FileBody(file));
			httpost.setEntity(entity);

			HttpResponse response;
							
			response = httpclient.execute(httpost);

			Log.d("httpPost", "Login form get: " + response.getStatusLine());

			if (entity != null) {
				entity.consumeContent();
			}
			success = true;
		} catch (Exception ex) {
			Log.d("FormReviewer", "Upload failed: " + ex.getMessage() + " Stacktrace: " + ex.getStackTrace());
			success = false;
		} finally {
			//mDebugHandler.post(mFinishUpload);
		}
		return success;
		*/
		return false;
	}
}

